Purpose

Here I am doing a contuation of the small experiment to compare different genetic architectures between snakes and newts. I will use the cost_1on1 simulation and my snake_newt_gv msprime simulation.

Outline

-Pick 5 different mu sigma combinations where mu*sigma^2 is constant -In total that will be 25 msprime simulations and 25 slim simulations -See if there are any obvious winners -make a co-evolutionary heatmap

Rerunning this experiment with these values

Things with 1e-6 mutation rate go every slow and end up with large file sizes. Might want to think about a different set

These are the results of the 25sims experiment. As a note the long sigma (1.581139) might be at a slight advantage because variation is 2.500001e-11

I ran msprime simulations and the slim simulations on cluster in GA_lt doover folder. My goal is to first see if there is an obvious “winner” in the co-evolutionary arms race between these species. And then to compare to part 1 of the experiment when some GA have an advantage/disadvantage

Explore Phenotype and Population Size

First, I want to look at the mean pheotypes of newts and snakes as the generations increase. Then I want to look at the difference between the mean phenotypes for each of the 25 simulations. I need to make the data frame to compare all 25 simulations.

R-code noate: I have code to make my dataframes, it combines many simulations into one graph-able dataframe. Then, I have some functions that can be called to make some figures. Will need to change this once more simulations are run.

The first step in seeing if there is a winner in the coevolution interaction is to read in the data and look at the results. I make a dataframe named GA_file. It contains all of the data points from my 25 simulations. I normally look at one variable at a time from all of my simulations, but since there are so few I can look at them all at once. There are over 6,000 observations with 28 variables which contains information from both newts and snakes. I focus on the mean phenotype of both the newt and the snake, usually creating a variable that looks at the difference between the mean pheotypes.

Since there are 25 simulations, for convenience I print out the simulation letter with the paramiter I used for the snake and newt mutation rate and mutation effect size

## [1] "Simulation A: Snake mu-rate & effect sd (1.0e-08, 0.05) Newt mu-rate & effect sd (1.0e-08, 0.05)"
## [1] "Simulation B: Snake mu-rate & effect sd (1.0e-08, 0.05) Newt mu-rate & effect sd (1.0e-09, 0.158114)"
## [1] "Simulation C: Snake mu-rate & effect sd (1.0e-08, 0.05) Newt mu-rate & effect sd (1.0e-10, 0.5)"
## [1] "Simulation D: Snake mu-rate & effect sd (1.0e-08, 0.05) Newt mu-rate & effect sd (1.0e-11, 1.58114)"
## [1] "Simulation E: Snake mu-rate & effect sd (1.0e-08, 0.05) Newt mu-rate & effect sd (1.0e-12, 5.0)"
## [1] "Simulation F: Snake mu-rate & effect sd (1.0e-09, 0.158114) Newt mu-rate & effect sd (1.0e-08, 0.05)"
## [1] "Simulation G: Snake mu-rate & effect sd (1.0e-09, 0.158114) Newt mu-rate & effect sd (1.0e-09, 0.158114)"
## [1] "Simulation H: Snake mu-rate & effect sd (1.0e-09, 0.158114) Newt mu-rate & effect sd (1.0e-10, 0.05)"
## [1] "Simulation I: Snake mu-rate & effect sd (1.0e-09, 0.158114) Newt mu-rate & effect sd (1.0e-11, 1.58114)"
## [1] "Simulation J: Snake mu-rate & effect sd (1.0e-09, 0.158114) Newt mu-rate & effect sd (1.0e-12, 5.0)"
## [1] "Simulation K: Snake mu-rate & effect sd (1.0e-10, 0.5) Newt mu-rate & effect sd (1.0e-08, 0.05)"
## [1] "Simulation L: Snake mu-rate & effect sd (1.0e-10, 0.5) Newt mu-rate & effect sd (1.0e-09, 0.158114)"
## [1] "Simulation M: Snake mu-rate & effect sd (1.0e-10, 0.5) Newt mu-rate & effect sd (1.0e-10, 0.5)"
## [1] "Simulation N: Snake mu-rate & effect sd (1.0e-10, 0.5) Newt mu-rate & effect sd (1.0e-11, 1.58114)"
## [1] "Simulation O: Snake mu-rate & effect sd (1.0e-10, 0.5) Newt mu-rate & effect sd (1.0e-12, 5.0)"
## [1] "Simulation P: Snake mu-rate & effect sd (1.0e-11, 1.58114) Newt mu-rate & effect sd (1.0e-08, 0.05)"
## [1] "Simulation Q: Snake mu-rate & effect sd (1.0e-11, 1.58114) Newt mu-rate & effect sd (1.0e-09, 0.158114)"
## [1] "Simulation R: Snake mu-rate & effect sd (1.0e-11, 1.58114) Newt mu-rate & effect sd (1.0e-10, 0.5)"
## [1] "Simulation S: Snake mu-rate & effect sd (1.0e-11, 1.58114) Newt mu-rate & effect sd (1.0e-11, 1.58114)"
## [1] "Simulation T: Snake mu-rate & effect sd (1.0e-11, 1.58114) Newt mu-rate & effect sd (1.0e-12, 5.0)"
## [1] "Simulation U: Snake mu-rate & effect sd (1.0e-12, 5.0) Newt mu-rate & effect sd (1.0e-08, 0.05)"
## [1] "Simulation V: Snake mu-rate & effect sd (1.0e-12, 5.0) Newt mu-rate & effect sd (1.0e-09, 0.158114)"
## [1] "Simulation W: Snake mu-rate & effect sd (1.0e-12, 5.0) Newt mu-rate & effect sd (1.0e-10, 0.5)"
## [1] "Simulation X: Snake mu-rate & effect sd (1.0e-12, 5.0) Newt mu-rate & effect sd (1.0e-11, 1.58114)"
## [1] "Simulation Y: Snake mu-rate & effect sd (1.0e-12, 5.0) Newt mu-rate & effect sd (1.0e-12, 5.0)"

The first thing I want to look at are the difference between snake and newt mean phenotypes as the number of generations increases.

describe results

Next, I checked the population size of newts and snakes through out the 5,000 generations.

desrbe plots

25 Simulation Plots

To get a better idea of what is going on in each simulation I plot newt population size by snake population size and color the points with the difference between snake and newt mean phenotype. The results are really cool to look at!

describe this plot and talk about how it compares to the 16 sim one

To do a reverse check I plot newt mean phenotype by snake mean phenotype and color with the population size.

I also decided to look at the mean predation of newts by taking newt death (caused by snakes) and dividing by the total newt population size (not sure if this counts the newts that just died). Predation does not look all that different between simulations to me. Should it look different?

Thoughts about predation:

Longer Simulations

To examined what would happen if I kept running my simulations for longer I repeated the experiment with 20,000 generations and then again with 100,000 generations. Below are the summary figures for these simulations. The first figure presented shows all 25 simulations the x axis is newt population size and the y axis is snake population size. The color of the points is the difference between snake mean phenotype and newt mean phenotype. If the point is blue snakes have a higher phenotype, if the point is beige snakes and newts have a similar, and if the point is red newts have a higher phenotype.

## [1] "20,000 Gen Simulation A: Snake (1.0e-08, 0.05) Newt (1.0e-08, 0.05)"
## [1] "20,000 Gen Simulation B: Snake (1.0e-08, 0.05) Newt (1.0e-09, 0.158114)"
## [1] "20,000 Gen Simulation C: Snake (1.0e-08, 0.05) Newt (1.0e-10, 0.5)"
## [1] "20,000 Gen Simulation D: Snake (1.0e-08, 0.05) Newt (1.0e-11, 1.58114)"
## [1] "20,000 Gen Simulation E: Snake (1.0e-08, 0.05) Newt (1.0e-12, 5.0)"
## [1] "20,000 Gen Simulation F: Snake (1.0e-09, 0.158114) Newt (1.0e-08, 0.05)"
## [1] "20,000 Gen Simulation G: Snake (1.0e-09, 0.158114) Newt (1.0e-09, 0.158114)"
## [1] "20,000 Gen Simulation H: Snake (1.0e-09, 0.158114) Newt (1.0e-10, 0.05)"
## [1] "20,000 Gen Simulation I: Snake (1.0e-09, 0.158114) Newt (1.0e-11, 1.58114)"
## [1] "20,000 Gen Simulation J: Snake (1.0e-09, 0.158114) Newt (1.0e-12, 5.0)"
## [1] "20,000 Gen Simulation K: Snake (1.0e-10, 0.5) Newt (1.0e-08, 0.05)"
## [1] "20,000 Gen Simulation L: Snake (1.0e-10, 0.5) Newt (1.0e-09, 0.158114)"
## [1] "20,000 Gen Simulation M: Snake (1.0e-10, 0.5) Newt (1.0e-10, 0.5)"
## [1] "20,000 Gen Simulation N: Snake (1.0e-10, 0.5) Newt (1.0e-11, 1.58114)"
## [1] "20,000 Gen Simulation O: Snake (1.0e-10, 0.5) Newt (1.0e-12, 5.0)"
## [1] "20,000 Gen Simulation P: Snake (1.0e-11, 1.58114) Newt (1.0e-08, 0.05)"
## [1] "20,000 Gen Simulation Q: Snake (1.0e-11, 1.58114) Newt (1.0e-09, 0.158114)"
## [1] "20,000 Gen Simulation R: Snake (1.0e-11, 1.58114) Newt (1.0e-10, 0.5)"
## [1] "20,000 Gen Simulation S: Snake (1.0e-11, 1.58114) Newt (1.0e-11, 1.58114)"
## [1] "20,000 Gen Simulation T: Snake (1.0e-11, 1.58114) Newt (1.0e-12, 5.0)"
## [1] "20,000 Gen Simulation U: Snake (1.0e-12, 5.0) Newt (1.0e-08, 0.05)"
## [1] "20,000 Gen Simulation V: Snake (1.0e-12, 5.0) Newt (1.0e-09, 0.158114)"
## [1] "20,000 Gen Simulation W: Snake (1.0e-12, 5.0) Newt (1.0e-10, 0.5)"
## [1] "20,000 Gen Simulation X: Snake (1.0e-12, 5.0) Newt (1.0e-11, 1.58114)"
## [1] "20,000 Gen Simulation Y: Snake (1.0e-12, 5.0) Newt (1.0e-12, 5.0)"

compare 20,000 generation plot 5,000 generation plot

Next, I plotted the same figure with the 100,000 generation data.

## [1] "100,000 Gen Simulation A: Snake (1.0e-08, 0.05) Newt (1.0e-08, 0.05)"
## [1] "100,000 Gen Simulation B: Snake (1.0e-08, 0.05) Newt (1.0e-09, 0.158114)"
## [1] "100,000 Gen Simulation C: Snake (1.0e-08, 0.05) Newt (1.0e-10, 0.5)"
## [1] "100,000 Gen Simulation D: Snake (1.0e-08, 0.05) Newt (1.0e-11, 1.58114)"
## [1] "100,000 Gen Simulation E: Snake (1.0e-08, 0.05) Newt (1.0e-12, 5.0)"
## [1] "100,000 Gen Simulation F: Snake (1.0e-09, 0.158114) Newt (1.0e-08, 0.05)"
## [1] "100,000 Gen Simulation G: Snake (1.0e-09, 0.158114) Newt (1.0e-09, 0.158114)"
## [1] "100,000 Gen Simulation H: Snake (1.0e-09, 0.158114) Newt (1.0e-10, 0.05)"
## [1] "100,000 Gen Simulation I: Snake (1.0e-09, 0.158114) Newt (1.0e-11, 1.58114)"
## [1] "100,000 Gen Simulation J: Snake (1.0e-09, 0.158114) Newt (1.0e-12, 5.0)"
## [1] "100,000 Gen Simulation K: Snake (1.0e-10, 0.5) Newt (1.0e-08, 0.05)"
## [1] "100,000 Gen Simulation L: Snake (1.0e-10, 0.5) Newt (1.0e-09, 0.158114)"
## [1] "100,000 Gen Simulation M: Snake (1.0e-10, 0.5) Newt (1.0e-10, 0.5)"
## [1] "100,000 Gen Simulation N: Snake (1.0e-10, 0.5) Newt (1.0e-11, 1.58114)"
## [1] "100,000 Gen Simulation O: Snake (1.0e-10, 0.5) Newt (1.0e-12, 5.0)"
## [1] "100,000 Gen Simulation P: Snake (1.0e-11, 1.58114) Newt (1.0e-08, 0.05)"
## [1] "100,000 Gen Simulation Q: Snake (1.0e-11, 1.58114) Newt (1.0e-09, 0.158114)"
## [1] "100,000 Gen Simulation R: Snake (1.0e-11, 1.58114) Newt (1.0e-10, 0.5)"
## [1] "100,000 Gen Simulation S: Snake (1.0e-11, 1.58114) Newt (1.0e-11, 1.58114)"
## [1] "100,000 Gen Simulation T: Snake (1.0e-11, 1.58114) Newt (1.0e-12, 5.0)"
## [1] "100,000 Gen Simulation U: Snake (1.0e-12, 5.0) Newt (1.0e-08, 0.05)"
## [1] "100,000 Gen Simulation V: Snake (1.0e-12, 5.0) Newt (1.0e-09, 0.158114)"
## [1] "100,000 Gen Simulation W: Snake (1.0e-12, 5.0) Newt (1.0e-10, 0.5)"
## [1] "100,000 Gen Simulation X: Snake (1.0e-12, 5.0) Newt (1.0e-11, 1.58114)"
## [1] "100,000 Gen Simulation Y: Snake (1.0e-12, 5.0) Newt (1.0e-12, 5.0)"

note differences between 10000, 20000, and 5000 gen plots. Next, I plotted the mean newt phenotype, snake mean phenotype and the difference between snake-newt phenotype as the number of generations increased.

what are the reults and what do they mean? how do they compare with the other set of simulations

Summarized Data

For this section summarized the data to presented in one plot. I summarize the last half of the data for 5,000 generations the last 1,500 generations for 20,000 generations and the last 10,000 generations for the 100,000 simulation. By summarizing the data I can try to compare the GA of the snakes tot the GA of the newts through information of their population sizes and phenotypes. I summarize by taking the mean value of a specific parameter.

In each of these plots color will represent the GA of the snake and shape will represent the GA of the newt. The colors and shapes are labeled with the mutation rate and mutation effect size sd separated by a subscript.

describe the figures not the shapes and colors. How does this compare to the 16 sims?

Summarize data Longer SImulations

I also summarized and examined the data for the simulations that I ran longer than the 5,000 generations.

other comparisions

##Heatmap

The last result section of this markdown will hold the results of my heat maps. My experiment had 25 simulations with 5 different types of GA for both the newts and snakes. My goal was to see if I could easily determine a winner from these results. All of the heat maps will have the GA of the newt along the x-axis and the GA of the snake along the y-axis. The intersection of the axis (a box) is one simulation that I ran. Each box will have a color that is either the population size of the snake or the difference between snake mean phenotype and newt mean phenotype.

For the 5,000 generation simulation I have created two heat maps. The first heatmap shows how the GA of newts and snakes effected the size of the snake population. Describe Now I will look at the results from the 20,000 generation experiment.

Write about the 20,000 generation experiment results

Lastly, I will look at the results from the 100,000 generation simulations.

Write about final results. Also talk about how these results are similar/differ from the 16 sim experiment

Conclusion & Thoughts